#ifndef SIMPLE_SUPPORT_TYPE_TRAITS_CAN_DEREF_HPP
#define SIMPLE_SUPPORT_TYPE_TRAITS_CAN_DEREF_HPP

#include <cstddef> // std::nullptr_t
#include <type_traits> // std::true_type std::false_type
#include <utility> // std::declval

namespace simple::support
{

	template <typename T, typename = std::nullptr_t>
	struct can_deref : public std::false_type {};

	template <typename T>
	struct can_deref<T, decltype(static_cast<void>(*std::declval<T>()), nullptr)>
		: public std::true_type {};

	template <typename T>
	constexpr bool can_deref_v = can_deref<T>::value;

} // namespace simple::support

#endif /* end of include guard */
